package eee.xiang.cloud_learning.service.design.responsibility;

/**
 * @Description
 * @Author Eee_xiang
 * @Date 2021/10/28
 **/
public class StuNameFilter implements Filter {
    @Override
    public void doFilter(Request request, Reponse reponse, FilterChain filterChain) {
        Stu stu = (Stu) request.getData();
        if (stu.getName().contains("虾皮")) {
            reponse.addData("名字不符合要求");
        } else {
            reponse.addData("名字正常符合要求");
        }
        filterChain.doFilter(request, reponse, filterChain);
    }
}
